import React, { Component } from 'react';
import { View, Text, FlatList } from 'react-native';

import NoDataView from '../../Views/NoDataView'
import index from '../Home/GoodsDetail';


function ListView(props) {
    let data = props.data
    if (data == undefined) {
        return (
            <NoDataView title='没有数据' style={{ flex: 1 }} />
        )
    } else {
        return (
            <FlatList style={{ flex: 1, backgroundColor: '#f5f5f5' }} data={data} keyExtractor={(item, index) => { return `${index}` }}
                renderItem={props.renderCell}
            />
        )
    }
}

export default class AllOrder extends Component {
    constructor(props) {
        super(props);
        this.state = {
        };
    }
    renderCell = (item, index) => {
        return (
            <View style={{ backgroundColor: '#ffffff', height: 44, borderBottomWidth: 1, borderBottomColor: '#f1f1f1' }}>
                
            </View>
        )
    }

    render() {
        return (
            <View style={{ display: 'flex', flexDirection: 'column', justifyContent: 'center', flex: 1 }}>
                <ListView data={[1, 2, 3]} renderCell={this.renderCell} />
            </View>
        );
    }
}
